<template>
	<!-- 添加车辆 -->
	<view class="addCar">
		<!-- <u-navbar title="快速下单" title-color="#333" back-icon-color="#333"></u-navbar> -->
		<view class="addCar-bottom">
			<view class="addCar-content-box">
				<view class="addCar-carName-phone">
					<text class="addCar-phone">账户：</text>
					<view class="addCar-input-one" @click="zhClick">
						<i v-if="Object.keys(account).length===0" class="addCar-phone-placeholder">请选择账户</i>
						<view v-else class="uni-input">{{account.ZHNAME}}</view>
					</view>

					<!-- <picker class="addCar-input-one" @change="bindPickerChange" :value="msgobj.wlcj" :range="cjArray"
						range-key="SETTB99CA00">
						
					</picker> -->
					<!-- <input class="addCar-input-one" type="text" placeholder="请选择厂家" v-model="msgobj.wlcj"
						maxlength="15" /> -->
				</view>
				<view class="addCar-carName-phone">
					<text class="addCar-phone">厂家：</text>
					<picker class="addCar-input-one" @change="bindPickerChange" :value="msgobj.wlcj" :range="cjArray"
						range-key="SETTB99CA00">
						<i class="addCar-phone-placeholder" v-if="msgobj.wlcj<0">请选择厂家</i>
						<view v-else class="uni-input" style="width: 150%;">{{cjArray[msgobj.wlcj].SETTB99CA00}}</view>
					</picker>
					<!-- <input class="addCar-input-one" type="text" placeholder="请选择厂家" v-model="msgobj.wlcj"
						maxlength="15" /> -->
				</view>
				<view class="addCar-carName-phone">
					<text class="addCar-phone">物料类型：</text>
					<picker class="addCar-input-one" @change="bindPickerWlChange" :value="msgobj.wllx" :range="wlArray"
						range-key="settb109CA00">
						<i class="addCar-phone-placeholder" v-if="msgobj.wllx<0">请选择物料</i>
						<view v-else class="uni-input">{{wlArray[msgobj.wllx].settb109CA00}}</view>
					</picker>
					<!-- <input class="addCar-input-one" type="text" placeholder="请输入物料名称" v-model="msgobj.wllx"
						maxlength="15" /> -->
				</view>
				<!-- <view class="addCar-carName-phone">
					<text class="addCar-phone">需求量：</text>
					<input class="addCar-input-one" type="number" placeholder="请输入需求量" v-model="msgobj.fdyf"
						maxlength="15" />
					<text>吨</text>
				</view> -->
				<!-- 	<view class="add-phone-main">


					<view class="addCar-carName-phone" v-for="(item, index) in list">
						<text class="addCar-phone">联系方式：</text>
						<input class="addCar-input-one" type="number" @input="phoneIptInput" placeholder="请输入联系方式"
							v-model="item.phone" maxlength="11" />
						<span style="color: red;" v-if="list.length>=2" @click="delItem(item)">删除</span>

					</view>
					<view class="add-phone" @click="addItem">添加</view>
				</view> -->
				<view class="addCar-carName-phone">
					<text class="addCar-phone">毛重：</text>
					<input class="addCar-input-one" @input="tareIptInput" placeholder="请输入毛重" type="number"
						v-model="tareIpt" />
					<text class="addCar-dun">吨</text>
				</view>
				<view class="addCar-carName-phone">
					<text class="addCar-phone">车牌号：</text>
					<!-- <input class="addCar-input-one" type="text" v-model="carNumberIpt"/> -->
					<view class="addCar-phone-car" @click="boardClick">
						{{carNumberIpt}}
						<text></text>
						<i class="addCar-phone-placeholder" v-if="carNumberIpt==''">请输入车牌号</i>


					</view>
					<text @click="carShowFun" style="color: rgba(0, 161, 244, 1);">历史车牌</text>
				</view>
				<view class="wrap">
					<view class="addCar-carName-phone" style="padding-left: 110rpx;" v-for="(item, index) in carList">
						<!-- <input class="addCar-input-one" type="text" v-model="carNumberIpt"/> -->
						<view class="addCar-phone-car">
							{{item.ORDTB400CA01}}
						</view>
						<text v-if="item.ORDTB400CA01" @click="delCar(item)"
							style="color:red;padding-left: 70rpx;">删除</text>
					</view>
				</view>

			</view>
			<!--  -->
			<view class="addCar-reset-determine">
				<!-- <view class="add-phone" @click="addItem">新增电话</view> -->
				<!-- <view class="addCar-reset" @click="reset">重置</view> -->
				<view class="addCar-determine" @click="determine">确定</view>
			</view>
		</view>
		<u-popup v-model="carshow" length="100%" mode="right" @close="carclose">
			<view class="iscar-nav">
				<view class="iscar-nav-top" v-if="platform==false"></view>
				<view v-else :style="{ height: systemInfo.statusBarHeight + 'px' }"></view>
				<view class="iscar-nav-search">
					<view class="iscar-nav-search-btn" @click="carshow=false">
						返回
					</view>
					<view class="iscar-nav-search-ipt">
						<u-search placeholder="请输入车牌号" @change="valChange" v-model="carSearch" :show-action="true"
							:action-style="actionStyle"></u-search>
					</view>
				</view>
				<view class="iscar-nav-btn">
					<view @click="checkedAll" v-if="ischeckedAll==true">全选</view>
					<view @click="nocheckedAll" v-if="ischeckedAll==false">全不选</view>
					<view @click="determineFun">确定</view>
				</view>
			</view>
			<view class="iscar-content" :style="platform==false?'padding-top: 24vh;':'padding-top: 14vh'">
				<view v-if="platform==true" :style="{ height: systemInfo.statusBarHeight + 'px' }"></view>
				<u-checkbox-group :wrap="false" width="350rpx" @change="checkboxGroupChange">
						<u-checkbox size='40' label-size="40" v-model="item.checked" v-for="(item, index) in carnumlist"
							:key="index" :name="item.name">{{item.name}}</u-checkbox>
					
				</u-checkbox-group>
			</view>
		</u-popup>

		<u-popup v-model="zhshow" length="100%" mode="right" @close="carclose">
			<view class="iscar-nav">
				<view class="iscar-nav-top" v-if="platform==false"></view>
				<view v-else :style="{ height: systemInfo.statusBarHeight + 'px' }"></view>
				<view class="iscar-nav-search">
					<view class="iscar-nav-search-btn" @click="zhshow=false">
						返回
					</view>
					<view class="iscar-nav-search-ipt">
						<u-search placeholder="请输入账号信息" @change="valAccouChange" v-model="accountSearch"
							:show-action="true" :action-style="actionStyle"></u-search>
					</view>
				</view>
				<view class="iscar-nav-btn">
					<view></view>
					<view @click="deteAccourmineFun">确定</view>
				</view>
			</view>
			<view class="iscar-content" :style="platform==false?'padding-top: 30vh;':'padding-top: 18vh'">
				<view v-if="platform==true" :style="{ height: systemInfo.statusBarHeight + 'px' }"></view>
				<u-radio-group v-model="radioChecked" @change="radioGroupChange">
					<u-radio size='40' @change="radioChange" label-size="38" v-for="(item, index) in accountnumlist"
						:key="index" :name="JSON.stringify(item.name)">{{item.name.ZHNAME}}
						<!-- <view class="">
								
						</view> -->
						<span style="color: #ccc;;padding-left: 20rpx;">{{item.name.ZHPHONE}}</span>
					</u-radio>
				</u-radio-group>
			</view>
		</u-popup>

		<u-modal v-model="addCarLoginShow" content="确定提交" :show-cancel-button="true" @confirm="addCarConfirm">
		</u-modal>
		<u-keyboard ref="uKeyboard" mode="car" @change="carValChange" @backspace="carBackspace" @confirm="sucAdd"
			v-model="carshow1" :mask="true" :mask-close-able="false"></u-keyboard>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userinfo: JSON.parse(uni.getStorageSync('userinfo')),
				platform: uni.getStorageSync('platform'),
				systemInfo: '',
				navHeight: '',
				carSearch: '',
				accountSearch: '',
				actionStyle: {
					backgroundColor: '#00a1f1',
					color: '#FFF',
					width: '100rpx',
					height: '60rpx',
					lineHeight: '60rpx',
					borderRadius: '15rpx',
					margin: '0 20rpx',
				},
				carnumlist: [],
				accountnumlist: [],
				account: {},
				radioChecked: '',
				ischeckedAll: true,
				componeryArr: [],
				carList: [],
				addressNew: null,
				Index: 0,
				diasabledInput: true, //可读不可写
				carNumberIpt: '', //车牌号
				nameIpt: '', //车主姓名
				phoneIpt: '', //联系方式
				tareIpt: 50, //联系方式
				addCarLoginShow: false,
				carshow1: false,
				carshow: false,
				zhshow: false,
				carType: '',
				typeid: '',
				zxobj: {
					zhdz: '',
					xhdz: -1,
					xhdzName: '',
					ORMTB404ID: ''
				},
				msgobj: {
					wllx: -1,
					wlcj: -1,
					wlcjName: '',
					wlcjId: '',
					wlcjdId: '',
					wllxName: '',
					wllxId: '',
					wllxDj: '',
					kd: '',
					cs: '',
					yf: '',
					cssj: '',
					fdyf: ''
				},
				remark: '',
				cjArray: [],
				xhArray: [],
				wlArray: [],
				page: 1,
				list1: [{
						name: '13米',
						checked: true,
						disabled: false
					},
					{
						name: '7米6',
						checked: false,
						disabled: false
					},
					{
						name: '9米6',
						checked: false,
						disabled: false
					}

				],
				cx: '13米',
				list: [{
					phone: ''
				}]
			}
		},
		onLoad() {
			this.getOrderList()
			// this.getxhOrderList()
			this.systemInfo = uni.getSystemInfoSync()
			this.navHeight = this.systemInfo.platform == 'ios' ? 44 : 48;
		},
		onShow() {
			console.log(this.account)
		},

		mounted() {

		},

		methods: {
			checkboxGroupChange() {
				var arr = []
				this.carnumlist.map(val => {
					if (val.checked == true) {
						arr.push(arr)
					}
				})
				if (arr.lenth == this.carnumlist.length) {
					this.ischeckedAll = false
				} else {
					this.ischeckedAll = true
				}
			},
			radioChange(e) {
				console.log(e);
			},
			radioGroupChange(e) {
				console.log(e);
				this.radioChecked = e
			},
			zhClick() {
				this.zhshow = true
				this.valAccouChange()
			},

			valChange() { //输入input发生变化
				this.carnumlist = []
				this.carSearch = this.carSearch.toUpperCase()
				uni.showLoading({
					title: '请求中...',
					mask: true
				});
				if (this.userinfo.sign == 'CUS-1') {
					var ID = this.userinfo.ORMTB400ID
				} else if (this.userinfo.sign == 'CUS-2' || this.userinfo.sign == 'CUS-3') {
					var ID = this.userinfo.ORMTB410ID
				}
				uni.request({
					url: this.baseUrl + '/orm/ormtb440/selectCarNumList',
					method: 'POST',
					dataType: 'json',
					data: {
						// sign: this.userinfo.sign,
						key: this.carSearch,
						ORMTB440CA02: ID,
					},
					success: (res) => {
						console.log(res);
						if (res.data.code == 200) {
							var data = res.data.data
							this.carnumlist = []
							data.forEach(item => {
								this.carnumlist.push({
									checked: false,
									name: item,
									disabled: false,
								})
							})
						} else {

						}
						uni.hideLoading();
					},
					fail: (res) => {
						uni.hideLoading();
						this.$refs.uToast.show({
							title: res.errMsg,
							type: 'default',
							icon: false
						})
					}
				});

			},
			valAccouChange() {
				this.accountnumlist = []
				this.accountSearch = this.accountSearch.toUpperCase()
				uni.showLoading({
					title: '请求中...',
					mask: true
				});
				// if (this.userinfo.sign == 'CUS-1') {
				// 	var ID = this.userinfo.ORMTB400ID
				// } else if (this.userinfo.sign == 'CUS-2' || this.userinfo.sign == 'CUS-3') {
				// 	var ID = this.userinfo.ORMTB410ID
				// }
				uni.request({
					url: this.baseUrl + '/orm/ormtb410/selectAccount',
					method: 'POST',
					dataType: 'json',
					data: {
						// sign: this.userinfo.sign,
						key: this.accountSearch
						// ORMTB440CA02: ID,
					},
					success: (res) => {
						console.log(res);
						if (res.data.code == 200) {
							var data = res.data.data
							this.accountnumlist = []
							data.forEach(item => {
								this.accountnumlist.push({
									checked: false,
									name: item,
									disabled: false,
								})
							})
						} else {

						}
						uni.hideLoading();
					},
					fail: (res) => {
						uni.hideLoading();
						this.$refs.uToast.show({
							title: res.errMsg,
							type: 'default',
							icon: false
						})
					}
				});
			},
			carclose() {
				this.carSearch = ''
				this.accountSearch = ''
			},
			// checkboxGroupChange() {
			// 	var arr = []
			// 	this.carnumlist.map(val => {
			// 		if (val.checked == true) {
			// 			arr.push(arr)
			// 		}
			// 	})
			// 	if (arr.lenth == this.carnumlist.length) {
			// 		this.ischeckedAll = false
			// 	} else {
			// 		this.ischeckedAll = true
			// 	}
			// },

			carShowFun() {
				this.carshow = true
				this.valChange()
			},
			checkedAll() {
				this.carnumlist.map(val => {
					val.checked = true
				})
				this.ischeckedAll = false
			},
			nocheckedAll() {
				this.carnumlist.map(val => {
					val.checked = false
				})
				this.ischeckedAll = true
			},

			determineFun() {
				this.carnumlist.forEach(item => {
					if (item.checked == true) {
						var i = (this.carList || []).findIndex((profile) => profile.ORDTB400CA01 === item.name);
						if (i == '-1') {
							console.log(item.name)
							var carObj = {
								ORDTB400CA01: item.name, //车牌号
							}
							this.carList.push(carObj)
							console.log(this.carList)
						}
					}
				})
				this.carshow = false
			},
			deteAccourmineFun() {
				// this.accountnumlist.forEach(item => {
				// 	if (item.checked == true) {
				// 		var i = (this.carList || []).findIndex((profile) => profile.ORDTB400CA01 === item.name);
				// 		if (i == '-1') {
				// 			console.log(item.name)
				// 			var carObj = {
				// 				ORDTB400CA01: item.name, //车牌号
				// 			}
				// 			this.carList.push(carObj)
				// 			console.log(this.carList)
				// 		}
				// 	}
				// })
				this.account = JSON.parse(this.radioChecked)

				this.zhshow = false
			},

			boardClick() {
				this.carshow1 = true
			},
			sucAdd(e) {
				console.log(this.carNumberIpt)
				//车牌号
				var regC =
					/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领])|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][0-9]{2}([0-9]|[A-Z]){5}))$/;
				// var regP = /^1[3-9][0-9]{9}$/;



				if (!regC.test(this.carNumberIpt)) return uni.showToast({
					title: '车牌号格式不正确，请检查',
					duration: 5000,
					icon: 'none',
				});
				else {
					this.carList.push({
						ORDTB400CA01: this.carNumberIpt
					})
					console.log(this.carList)
					this.carNumberIpt = ''
				}



			},
			delCar(item) {
				this.carList = this.carList.filter((i) => {
					return i != item
				})
			},

			bindPickerChange: function(e) {
				console.log('picker发送选择改变，携带值为', e.detail.value)
				this.msgobj.wlcj = e.detail.value
				console.log(typeof this.msgobj.wlcj)
				this.msgobj.wlcjName = this.cjArray[this.msgobj.wlcj].SETTB99CA00
				this.msgobj.wlcjId = this.cjArray[this.msgobj.wlcj].SETTB99ID
				this.msgobj.wlcjdId = this.cjArray[this.msgobj.wlcj].SETTB100ID

				this.queryGwcList()
				this.msgobj.wllx = -1
			},
			// bindxhPickerChange: function(e) {
			// 	console.log(this.xhArray)

			// 	if (this.xhArray.length == 0) {
			// 		uni.showToast({
			// 			title: '请先添加收货地',
			// 			type: 'default',
			// 			icon: 'none'
			// 		})

			// 	} else {
			// 		this.zxobj.xhdz = e.detail.value
			// 		this.zxobj.xhdzName = this.xhArray[this.zxobj.xhdz].ORMTB404CA00
			// 		this.zxobj.ORMTB404ID = this.xhArray[this.zxobj.xhdz].ORMTB404ID
			// 	}


			// },
			bindPickerWlChange(e) {
				this.msgobj.wllx = e.detail.value
				console.log('物料', this.msgobj.wllx)
				this.msgobj.wllxName = this.wlArray[this.msgobj.wllx].settb109CA00
				this.msgobj.wllxId = this.wlArray[this.msgobj.wllx].settb109ID
				this.msgobj.wllxDj = this.wlArray[this.msgobj.wllx].settb109CA01
				console.log(this.wlArray[this.msgobj.wllx].settb109ID)

			},


			// 企业列表
			getOrderList() {
				uni.showLoading({
					title: '请求中...',
					mask: true
				});
				uni.request({
					url: this.baseUrl + '/set/settb99/selectPageList',
					method: 'POST',
					dataType: 'json',
					data: {
						SETTB403CA00: this.userinfo.PERTB005ID,
						ORMTB410ID: this.userinfo.ORMTB410ID,
						ORMTB400ID: this.userinfo.ORMTB400ID, //一级客户ID
						SETTB99CA00: '', //二级企业名称
						SETTB100CA04: this.cityCode, //市代码
						page: this.page,
						limit: 100,
					},
					success: (res) => {
						uni.hideLoading();
						if (res.data.code == 200) {
							if (!res.data.data || res.data.data == null) {
								this.cjArray = []
								this.page = 1
								return
							}
							var data = res.data.data || []
							// console.log(data)
							this.cjArray = data
						} else {
							this.cjArray = []
							this.page = 1
							uni.showToast({
								title: res.data.message,
								type: 'default',
								icon: false
							})
						}
					},
					fail: (res) => {
						uni.hideLoading();
						uni.showToast({
							title: '服务器连接超时',
							type: 'default',
							icon: false
						})
					}
				});
			},
			// 物料列表
			queryGwcList() {
				uni.showLoading({
					title: '加载中...',
					mask: true
				});
				// this.materList=[]
				var ORMTB410ID = ''
				if (this.userinfo.sign == "CUS-2" || this.userinfo.sign == 'CUS-3') {
					ORMTB410ID = this.userinfo.ORMTB410ID
				}
				uni.request({
					url: this.baseUrl + '/orm/ormtb440/selectAllSettb109',
					method: 'POST',
					dataType: 'json',
					data: {
						SETTB99ID: this.msgobj.wlcjId, //二级企业代码
						ORMTB410ID: ORMTB410ID,
						sign: this.userinfo.sign,
					},
					success: (res) => {
						console.log(res);
						uni.hideLoading();
						if (res.data.code == 200) {
							// this.materList=res.data.data||[]
							this.wlArray = res.data.data || []
							console.log(this.wlArray)

						} else {
							uni.showToast({
								title: res.data.success,
								type: 'default',
								icon: false
							})
						}
					},
					fail: (res) => {
						uni.hideLoading();
						uni.showToast({
							title: res.errMsg,
							type: 'default',
							icon: false
						})
					}
				});
			},


			addItem() {
				if (this.list.length == 3) {
					uni.showToast({
						title: '最多三个',
						icon: 'none'
					})
					return false
				}
				// let add = {
				// 	id: parseInt(this.id) + 1
				// }
				this.list.push({
					phone: ''
				})
				// this.id = parseInt(this.id) + 1
				// this.phoneIpt += parseInt(this.id) + 1
				console.log(this.list)
			},
			delItem(item) {
				if (this.list.length == 1) {
					uni.showToast({
						title: '不能删除第1个',
						icon: 'none'
					})
					return false;
				}
				this.list = this.list.filter((i) => {
					return i != item
				})
			},
			carValChange(val) {
				// 将每次按键的值拼接到carNumberIpt变量中，注意+=写法
				this.carNumberIpt += val;
			},
			carBackspace() {
				// 删除carNumberIpt的最后一个字符
				if (this.carNumberIpt.length) this.carNumberIpt = this.carNumberIpt.substr(0, this.carNumberIpt.length -
					1);
			},
			tareIptInput() { //限制验证码长度
				if (this.tareIpt.length > 6) {
					this.tareIpt = this.tareIpt.slice(0, 6)
				}
			},
			phoneIptInput() {
				if (this.phoneIpt.length > 11) {
					this.phoneIpt = this.phoneIpt.slice(0, 11)
				}
			},
			// 确定
			determine() {

				// if (Object.keys(this.account).length===0) {
				// 	return uni.showToast({
				// 		title: '请选择下单账户',
				// 		duration: 5000,
				// 		icon: 'none',
				// 	});
				// }

				if (this.msgobj.wlcj == -1) {
					return uni.showToast({
						title: '请选择厂家',
						duration: 5000,
						icon: 'none',
					});
				}
				if (this.msgobj.wllx == -1) {
					return uni.showToast({
						title: '请选择物料',
						duration: 5000,
						icon: 'none',
					});
				}
				if (this.tareIpt == '') {
					return uni.showToast({
						title: '请输入毛重',
						duration: 5000,
						icon: 'none',
					});
				}
				if (this.carList.length == 0) {
					return uni.showToast({
						title: '请输入车牌号',
						duration: 5000,
						icon: 'none',
					});
				}




				//车牌号
				//var regC =
				///^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领])|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][0-9]{2}([0-9]|[A-Z]){5}))$/;
				// var regP = /^1[3-9][0-9]{9}$/;



				// if (!regC.test(this.carNumberIpt)) return uni.showToast({
				// 	title: '车牌号格式不正确，请检查',
				// 	duration: 5000,
				// 	icon: 'none',
				// });


				this.addCarLoginShow = true

			},
			addCarConfirm() {
				if (this.userinfo.sign == 'CUS-1') {
					var ORMTB400ID = this.userinfo.ORMTB400ID
				} else if (this.userinfo.sign == 'CUS-2' || this.userinfo.sign == 'CUS-3') {
					var ORMTB400ID = this.userinfo.ORMTB410ID
				}
				uni.request({
					url: this.baseUrl + '/orm/ormtb440/replaceInsert',
					method: 'POST',
					dataType: 'json',
					data: {
						ORDTB400CA09: this.msgobj.wlcjId, //厂家ID
						ORMTB440CA23: this.msgobj.wlcjdId, //厂家短ID
						ORMTB440CA24: this.msgobj.wlcjName, //厂家名称
						ORDTB400CA04: this.msgobj.wllxId, //物料ID
						ORMTB440CA07: this.msgobj.wllxName, //物料名称
						ORMTB440CA08: this.msgobj.wllxDj, //物料单价
						ORMTB410ID: ORMTB400ID,
						zl: this.tareIpt,
						ZHID: this.account.ZHID,
						ZHNAME: this.account.ZHNAME,
						ORMTB440CA17: this.userinfo.PERTB005ID, //登录用户ID
						ORMTB440CA18: this.userinfo.PERTB005CA02, //登录用户名称
						ORMTB410CA00: this.userinfo.ORMTB410CA00, //登录用户名称
						carList: this.carList
					},
					success: (res) => {
						console.log(res);
						if (res.data.code == 200) {
							uni.showToast({
								title: res.data.message,
								duration: 5000,
								icon: 'none',
							});
							uni.switchTab({
								url: '/pages/tabbar/sendorder/index',
							})
						} else {
							uni.showToast({
								title: res.data.message,
								duration: 5000,
								icon: 'none',
							});
						}
					},
					fail: (res) => {
						uni.showToast({
							title: res.data.message,
							duration: 5000,
							icon: 'none',
						});
					}
				});
			},
			// 重置
			reset() {
				this.carNumberIpt = '' //车牌号
				this.nameIpt = '' //车主姓名
				this.phoneIpt = '' //联系方式
				this.tareIpt = ''
			},
		}
	}
</script>

<style scoped>
	.addCar input {
		border: 0;
	}

	.addCar {
		width: 100%;
		min-height: 100vh;
		background-color: rgba(242, 242, 242, 1);
		overflow: hidden;
	}

	/* 列表 */

	/* 内容 */
	.addCar-content-box {
		/* width: 100%; */
		background: rgba(255, 255, 255, 1);
		padding: 10rpx 24rpx;
		margin: 20rpx;
		border-radius: 20rpx;
		box-shadow: 4rpx 4rpx 20rpx #e5e5e5;
	}

	.addCar-carName-phone {
		border-bottom: 2rpx solid rgba(230, 230, 230, 1);
		padding: 18rpx 0;
	}

	.addCar-input-one {
		width: 310rpx !important;
		display: inline-block;
		margin-bottom: 0 !important;
		padding: 0 !important;
		height: 44rpx !important;
		vertical-align: middle;
		/* margin-left: 0.1rem; */
		color: rgba(51, 51, 51, 1);
		font-size: 28rpx;
		/* text-align: center; */
	}

	.addCar-phone {
		width: 180rpx;
		display: inline-block;
		font-size: 30rpx;
		color: rgba(102, 102, 102, 1);
		vertical-align: middle;
		/* background: #000000; */
	}

	.addCar-phone-placeholder {
		font-size: 30rpx;
		color: rgba(102, 102, 102, .5);
	}

	.addCar-dun {
		color: rgba(51, 51, 51, 1);
		font-size: 30rpx;
	}

	/* 按钮 */
	.addCar-reset-determine {
		margin-top: 167rpx;
		display: flex;
		justify-content: center;
	}



	.addCar-reset-determine>view {
		width: 80%;
		text-align: center;
		line-height: 100rpx;
		color: rgba(255, 255, 255, 1);
		font-size: 32rpx;
		border-radius: 20rpx;
	}

	.addCar-reset {
		width: 159rpx;
		background: rgba(234, 197, 15, 1);
		text-align: center;
		/* margin-left: 170rpx; */
		margin: 0 20rpx;
	}

	.addCar-determine {
		background: rgba(0, 161, 244, 1);
		/* margin-left: 60rpx; */
	}

	.add-phone-main {
		position: relative;
	}

	.add-phone {
		position: absolute;
		top: 20rpx;
		right: 0;
		/* font-size: 50rpx; */
		color: rgba(0, 255, 127, 1);
		/* background: rgba(0, 255, 127, 1); */

	}

	.addCar-phone-car {
		display: inline-block;
		width: 310rpx;
		height: 44rpx;
		line-height: 44rpx;
		/* border: 1px solid rgba(0, 0, 0, .2); */
		/* border-radius: 3px; */
		text-align: center;
		vertical-align: middle;
		font-size: 30rpx;
	}

	input::placeholder {
		color: rgba(102, 102, 102, .5);
	}

	.item-box {
		display: flex;
	}

	.zhuang-huo-dizhi {
		background-color: #303133;
		color: #fff;
		border-radius: 50%;
		width: 50rpx;
		height: 50rpx;
		display: inline-block;
		font-size: 32rpx;
		text-align: center;
		margin-right: 10rpx;
		margin-bottom: 20rpx;
	}

	.xie-huo-dizhi {
		background-color: #2979ff;
		color: #fff;
		border-radius: 50%;
		width: 50rpx;
		height: 50rpx;
		display: inline-block;
		font-size: 32rpx;
		text-align: center;
		margin-right: 10rpx;
	}

	.zx-addres {
		background: rgba(255, 255, 255, 1);

		border-radius: 20rpx;
		box-shadow: 4rpx 4rpx 20rpx #e5e5e5;
		padding: 20rpx 24rpx;
		padding-bottom: 30rpx;
		/* border-bottom: 2rpx solid rgba(230, 230, 230, 1); */
		margin: 20rpx;

	}

	.cx-box {
		padding: 18rpx 0;
	}

	.text-jieshao {
		color: red;
		padding: 10rpx 24rpx;
	}

	.iscar-nav {
		position: fixed;
		top: 0;
		width: 100%;
		/* height: 22vh; */
		/* box-sizing: border-box; */
		z-index: 2;
		background-color: #FFF;
	}

	.iscar-content {
		/* margin-top: 24vh; */
	}

	.iscar-nav-top {
		height: 10vh;
		/* background-color: #e3e3e3; */
	}

	.iscar-nav-search {
		display: flex;
		/* background-color: #e3e3e3; */
		padding-bottom: 20rpx;
	}

	.iscar-nav-search-ipt {
		flex: 1;
	}

	.iscar-nav-search-btn {
		width: 100rpx;
		height: 60rpx;
		line-height: 60rpx;
		font-size: 28rpx;
		text-align: center;
		color: #333;
		margin: 0 20rpx;
	}

	.iscar-nav-btn {
		display: flex;
		justify-content: space-between;
		height: 90rpx;
		line-height: 90rpx;
		font-size: 36rpx;
		color: #333;
		padding: 0 40rpx;
		border-top: 2rpx solid #e3e3e3;
		border-bottom: 2rpx solid #e3e3e3;
		background-color: #fff;
	}

	.iscar-nav-btn view+view {
		color: #02a2f4;
	}

	.iscar-nav-btn view {
		/* width: 100rpx; */
		text-align: center;
	}

	.iscar-content {
		padding-left: 30rpx;
	}

	.sendcar-addcar {
		padding: 20rpx 20rpx;
		color: #02a2f4;
		font-size: 38rpx;
		background-color: #fff;
	}

	.sendcar-bottom-height {
		height: 120rpx;
	}

	.sendcar-bottome-nav {
		position: fixed;
		left: 0;
		bottom: 0;
		width: 100%;
		display: flex;
		height: 120rpx;
		overflow: hidden;
		box-sizing: border-box;
		z-index: 2;
		background-color: #fff;
	}

	.sendcar-bottome-nav-l {
		flex: 1;
		text-align: right;
		padding-right: 20rpx;
		margin-top: 20rpx;
	}

	.sendcar-bottome-nav-l-t {
		height: 40rpx;
		font-size: 34rpx;
		color: #333;
		overflow: hidden;
	}

	.sendcar-bottome-nav-l-b {
		height: 40rpx;
		overflow: hidden;
		font-size: 24rpx;
		color: #999;
	}

	.sendcar-bottome-nav-l-b text {
		margin-right: 10rpx;
	}

	.sendcar-bottome-nav-r>button {
		display: inline-block;
		height: 120rpx;
		line-height: 120rpx;
		color: #FFF;
		background-color: #02a2f4;
		/* background-color: #e5c000; */
		font-size: 32rpx;
	}

	.sendcar-bottome-nav-r>button+button {
		background-color: #02a2f4;
		margin-left: 5rpx;
	}
</style>
